
/**
*World
*Za Warudo
*Date: Dec 2011
*/
#ifndef WORLD_H
#define WORLD_H 

#include "types.hpp"

class Creature;
class Food;

class World {

public:
    World();
    ~World();
    bool init(uint nCreature, uint nFood, uint xSize, uint ySize);
    void moveScreen(uint x, uint y, uint scale);
    void update();
    void paint();
    Creature * getCreatures ();
    void saveCreature (uint index, const char * filename);
    void loadCreature (uint index, const char * filename);
    void AttractCreatures(uint x, uint y);
    void SlowDownAll();

private:
    uint       m_nCreature;
    Creature * m_creatures;
    Food *     m_food;
    //screen center position
    //for possible zoom
    uint       m_xScr;
    uint       m_yScr;
    uint       m_scale;
    //max world size
    uint       m_xSize;
    uint       m_ySize;
    //ticks passed
    uint       m_tick;
    uint       m_state; //0 - run, 1 - pause

    void applyCollision();
};

#endif

